<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<title>集团律师验证成功</title>
		<!-- Tell the browser to be responsive to screen width -->
		<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
		<!-- Bootstrap 3.3.5 -->
		<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
		<!-- Font Awesome -->
		<link rel="stylesheet" href="//cdn.bootcss.com/font-awesome/4.5.0/css/font-awesome.css">
		<!-- Theme style -->
		<link rel="stylesheet" href="css/AdminLTE.css">
		<!-- AdminLTE Skins. We have chosen the skin-blue for this starter
          page. However, you can choose any other skin. Make sure you
          apply the skin class to the body tag so the changes take effect.
    -->
		<!--<link rel="stylesheet" href="css/skins/skin-blue.min.css">-->
		<link rel="stylesheet" type="text/css" href="css/ant-login.css" />

		<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
		<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
		<!--[if lt IE 9]>
        <script src="//cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script>
        <script src="//cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
	</head>

	<body>
		<div id="" class="container">
			<div class="row">
				<div class="col-md-12 text-center">
					<img src="img/logo2.png" />
				</div>
			</div>
		</div>
		<div class="container ant-regcontainer">
			<div class="row">
				<div class="col-xs-6 text-center opacity50" style="background: #C0C0C0;">
					<h3 class="color-c">注册</h3>
				</div>
				<div class="col-xs-6 text-center " style="border-top: #C87F0A 2px solid;">
					<h3 class="color-y">集团律师验证</h3>
				</div>
			</div>
			<div class="row" style="padding-top: 20px;">
				<div class="col-md-6 col-md-offset-3">
					<form action="jumptologin.action" class="form-horizontal regForm" method="post" name="form">
						<div class="form-group">
							<div class="col-sm-12">
								<div class="text-center">
									<label>
										<h3> 恭喜您，验证成功！</h3>
									</label>
								</div>
							</div>
						</div>
						
						<div class="form-group has-feedback">
							<label for="phonenumber" class="col-sm-3 control-label">用户名 *</label>
							<div class="col-sm-6">
								<!--<label class="icon-user"><i class="fa fa-user fa-2x"></i></label>-->
								<input type="text" id="username" name="username" value="<s:property value='phonenumber'/>"  readonly="true"class="form-control" placeholder="用户名" />
								<span class="glyphicon glyphicon-user form-control-feedback"></span>
							</div>
							<div class="col-sm-3">
							</div>
						</div>
						
						<div class="form-group has-feedback">
							<label for="phonenumber" class="col-sm-3 control-label">执业证号 *</label>
							<div class="col-sm-6">
								<!--<label class="icon-user"><i class="fa fa-user fa-2x"></i></label>-->
								<input type="text" id="license" name="license" value="<s:property value='license'/>"  readonly="true"class="form-control" placeholder="用户名" />
								<span class="glyphicon glyphicon-user form-control-feedback"></span>
							</div>
							<div class="col-sm-3">
							</div>
						</div>
						<div class="form-group has-feedback">
							<label for="phonenumber" class="col-sm-3 control-label">密码 *</label>
							<div class="col-sm-6">
								<input type="password" id="password" name="password" class="form-control" onFocus="input_password" onBlur="check_password()" placeholder="3~16位数字或字母" />
								<span class="glyphicon glyphicon-lock form-control-feedback"></span>
								 <lable id="tip"></lable>
							</div>
							<div class="col-sm-3">
							</div>
						</div>
						<div class="form-group has-feedback">
							<label for="password2" class="col-sm-3 control-label">确认密码 *</label>
							<div class="col-sm-6">
								<input type="password" id="password2" name="password2" class="form-control" onBlur="check_password2()" placeholder="同密码一致" />
								<span class="glyphicon glyphicon-lock form-control-feedback"></span>
								<lable id="tip_password"></lable>
							</div>
							<div class="col-sm-3">
							</div>
						</div>
						</form>
						<div class="form-group">
							<div class="col-sm-offset-3 col-sm-9">
								<div class="checkbox">
									<label>
										<p> 注册即代表同意《德恒用户注册协议》</p>
									</label>
								</div>
							</div>
						</div>

						

						<div class="form-group">
							<div class="col-sm-offset-3 col-sm-6">
								<a class="btn btn-warning btn-block" id="register">立即注册</a>
							</div>
							<div class="col-sm-3">

							</div>
						</div>
					
				</div>
			</div>
		</div>
		<div class="hidden-xs">
			<div class="container" style="padding-top: 20px;">
				<a href="#" target="_blank">关于我们</a>|
				<a href="#" target="_blank">隐私条款</a>|
				<a href="#" target="_blank">社区规范</a>|
				<a href="#" target="_blank">用户反馈</a>|
				<a href="#" target="_blank">加入我们</a>|
				<a href="#" target="_blank">版权声明</a>
			</div>
		</div>
		<!--<nav class="  hidden-xs" style="  background: #2d3237;">
			<div class="container">
				<div class="row">
					<div class="col-md-6">
						<div class="row ant-footer">
							<div class="col-md-12" style="color: #fff;">
								<h3>
									InterLaw | <small>在线律师管理系统</small>            </h3>
							</div>
							<div class="col-md-12">
								<a href="#" target="_blank">关于我们</a>|
								<a href="#" target="_blank">隐私条款</a>|
								<a href="#" target="_blank">社区规范</a>|
								<a href="#" target="_blank">用户反馈</a>|
								<a href="#" target="_blank">加入我们</a>|
								<a href="#" target="_blank">版权声明</a>
								<br /> v
							</div>
						</div>
					</div>
					<div class="col-md-6">

					</div>

				</div>

			</div>
		</nav>-->
		<!--针对小屏幕显示-->
		<!--<div class="container visible-xs-inline-block">
			<div class="row">
				<div class="col-md-12">
					<a href="#" target="_blank">关于我们</a>|
					<a href="#" target="_blank">隐私条款</a>|
					<a href="#" target="_blank">社区规范</a>|
					<a href="#" target="_blank">用户反馈</a>|
					<a href="#" target="_blank">加入我们</a>|
					<a href="#" target="_blank">版权声明</a>
				</div>
			</div>
		</div>-->
		<!--针对小屏幕显示结束-->

		<!--<script src="jQuery/jQuery-2.1.4.min.js"></script>-->
		<script src="jQuery/jquery-1.11.2.min.js" type="text/javascript"></script>
		<!-- Bootstrap 3.3.5 -->
		<script src="bootstrap/js/bootstrap.min.js"></script>
		<!--<script type="text/javascript" src="js/login.js"></script>-->
		<script src="js/jquery.cookie.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript"></script>
		 <script>
  var phonenumber="";   //手机号
  var password="";
  var license="";
//发送验证码
function sendCode(){
//alert(username.value);
 $.ajax({
type: "POST",
url:"registerforourlawyer.action",	//把表单数据发送到ajax.jsp
dataType: "json", 	//返回数据类型
data:{
"phonenumber":username.value,//电话号码作为用户名
"password":password.value,
"license":license.value
},
async: true,
error: function(request) {
alert("发送请求失败！");
},
success: function(data) {
var json = eval("(" + data + ")"); 
if(json.code=="true"){
document.form.submit();
}
}
});
}
  onload=function()
{
 username = document.getElementById("username");//js形式获得bieshehuile````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````			```````
 password = document.getElementById("password"); 
 license = document.getElementById("license"); 
}
 function input_password(){
$("#tip").text("密码为3-16位的数字或字母");
}
function check_password(){
	var myreg = /^[a-zA-Z0-9_]{3,16}$/; //正则表达式 3-16
	if(!myreg.test(document.getElementById("password").value)) //不匹配的情况
	{
		$("#tip").text("密码格式错误,必须为3-16位的数字或字母");	
	} 
	else $("#tip").text("");
}
function check_password2(){
	if(document.getElementById("password").value!=document.getElementById("password2").value) //不匹配的情况
	{
		$("#tip_password").text("两次密码输入不一致");
	} 
	else $("#tip_password").text("");
}
function check()
{
	if(tip.innerHTML!=null&&tip.innerHTML!=""){
	alert("密码输入有误,请检查");
	return false;
	}
	else if(tip_password.innerHTML!=null&&tip_password.innerHTML!=""){
	alert("两次密码输入不一致");
	return false;
	}
	return true;
}
        $(document).ready(function(){  //页面加载完成即执行
        $("#register").click(function(){//获取验证码响应JQuery
        onload();
         //检验手机号是否违法
         if(check()){
          sendCode();  // ajax发送数据       
         }
       
});     //验证按钮响应            
});    
  </script >
	</body>

</html>